// File generated from our OpenAPI spec by Stainless.

package com.metest.api.services.async.rest.actuator

import com.metest.api.TestServerExtension
import com.metest.api.client.okhttp.MetestOkHttpClientAsync
import com.metest.api.models.rest.actuator.loggers.LoggerUpdateParams
import org.junit.jupiter.api.Disabled
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.extension.ExtendWith

@ExtendWith(TestServerExtension::class)
internal class LoggerServiceAsyncTest {

    @Disabled("Prism tests are disabled")
    @Test
    fun retrieve() {
        val client =
            MetestOkHttpClientAsync.builder()
                .baseUrl(TestServerExtension.BASE_URL)
                .apiKey("My API Key")
                .build()
        val loggerServiceAsync = client.rest().actuator().loggers()

        val loggerFuture = loggerServiceAsync.retrieve("name")

        val logger = loggerFuture.get()
        logger.validate()
    }

    @Disabled("Prism tests are disabled")
    @Test
    fun update() {
        val client =
            MetestOkHttpClientAsync.builder()
                .baseUrl(TestServerExtension.BASE_URL)
                .apiKey("My API Key")
                .build()
        val loggerServiceAsync = client.rest().actuator().loggers()

        val future =
            loggerServiceAsync.update(
                LoggerUpdateParams.builder()
                    .name("name")
                    .body(LoggerUpdateParams.Body.TRACE)
                    .build()
            )

        val response = future.get()
    }

    @Disabled("Prism tests are disabled")
    @Test
    fun list() {
        val client =
            MetestOkHttpClientAsync.builder()
                .baseUrl(TestServerExtension.BASE_URL)
                .apiKey("My API Key")
                .build()
        val loggerServiceAsync = client.rest().actuator().loggers()

        val loggersFuture = loggerServiceAsync.list()

        val loggers = loggersFuture.get()
        loggers.validate()
    }
}
